<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>测试bopomofo-jquery.js</title>
	</head>
	<body>
	</body>
	<script type="text/javascript" src="../libs/pinyins.js" ></script>
	<script type="text/javascript" src="../libs/polyphones.js" ></script>
	<script src="http://cdn.bootcss.com/jquery/3.4.1/jquery.js"></script>
	<script type="text/javascript" src="../bopomofo-jquery.js" ></script>
	<!--assertEquals(expected, actual) 是一个仿照junit的断言函数的JS实现-->
	<script type="text/javascript" src="../libs/jsunit.js" ></script>
	<script>
		$(document).ready(function(){
			var bopomofo = $.bopomofo();
			{
				var v1 = bopomofo.pinyin('中国人！');
				console.log(v1);
				assertEquals('zhōng guó rén！', v1);
			}
			{
				var v1 = bopomofo.pinyin('中国人！',0);
				console.log(v1);
				assertEquals('zhōng guó rén！', v1);
			}
			{
				var v1 = bopomofo.pinyin('中国人！',0, false);
				console.log(v1);
				assertEquals('zhōng guó rén！', v1);
			}
			{
				var v1 = bopomofo.pinyin('中国人！',0, true);
				console.log(v1);
				assertEquals('ZHŌNG GUÓ RÉN！', v1);
			}
			{
				var v1 = bopomofo.pinyin('中国人！',0, false, false);
				console.log(v1);
				assertEquals('zhōng guó rén！', v1);
			}
			{
				var v1 = bopomofo.pinyin('中国人！',0, true, false);
				console.log(v1);
				assertEquals('ZHŌNG GUÓ RÉN！', v1);
			}
			{
				var v1 = bopomofo.pinyin('中国人！',0, true, true);
				console.log(v1);
				assertEquals('ZHŌNG GUÓ RÉN！', v1);
			}
			{
				var v1 = bopomofo.pinyin('中国人！',0, false, true);
				console.log(v1);
				assertEquals('Zhōng Guó Rén！', v1);
			}
			{
				var v1 = bopomofo.pinyin('中国人！',0, false, false, ',');
				console.log(v1);
				assertEquals('zhōng,guó,rén！', v1);
			}
			{
				var v1 = bopomofo.pinyin('中国人！',0, false, true, ',');
				console.log(v1);
				assertEquals('Zhōng,Guó,Rén！', v1);
			}
			{
				var v1 = bopomofo.pinyin('中国人！',0, true, true, ',');
				console.log(v1);
				assertEquals('ZHŌNG,GUÓ,RÉN！', v1);
			}
			{
				var v1 = bopomofo.pinyin('患难与共的兄弟！！');
				console.log(v1);
				assertEquals('huàn nàn yǔ gòng de xiōng dì！！', v1);
			}
			{
				var v1 = bopomofo.pinyin('患难与共的兄弟！！',1);
				console.log(v1);
				assertEquals('huan4 nan4 yu3 gong4 de0 xiong1 di4！！', v1);
			}
			{
				var v1 = bopomofo.pinyin('患难与共的兄弟！！',1, false);
				console.log(v1);
				assertEquals('huan4 nan4 yu3 gong4 de0 xiong1 di4！！', v1);
			}
			{
				var v1 = bopomofo.pinyin('患难与共的兄弟！！',1, false, false);
				console.log(v1);
				assertEquals('huan4 nan4 yu3 gong4 de0 xiong1 di4！！', v1);
			}
			{
				var v1 = bopomofo.pinyin('患难与共的兄弟！！',1, false, false, ',');
				console.log(v1);
				assertEquals('huan4,nan4,yu3,gong4,de0,xiong1,di4！！', v1);
			}
			{
				var v1 = bopomofo.pinyin('this is a pinyin library!这是一个汉语拼音库！！');
				console.log(v1);
				assertEquals('this is a pinyin library! zhè shì yī gè hàn yǔ pīn yīn kù！！', v1);
			}
			{
				var v1 = bopomofo.pinyin('this is a pinyin library!这是一个汉语拼音库！！',2);
				console.log(v1);
				assertEquals('this is a pinyin library! zhe shi yi ge han yu pin yin ku！！', v1);
			}
			{
				var v1 = bopomofo.pinyin('this is a pinyin library!这是一个汉语拼音库！！',2, false);
				console.log(v1);
				assertEquals('this is a pinyin library! zhe shi yi ge han yu pin yin ku！！', v1);
			}
			{
				var v1 = bopomofo.pinyin('this is a pinyin library!这是一个汉语拼音库！！',2, false, false);
				console.log(v1);
				assertEquals('this is a pinyin library! zhe shi yi ge han yu pin yin ku！！', v1);
			}
			{
				var v1 = bopomofo.pinyin('this is a pinyin library!这是一个汉语拼音库！！',2, false, false, ',');
				console.log(v1);
				assertEquals('this is a pinyin library!,zhe,shi,yi,ge,han,yu,pin,yin,ku！！', v1);
			}
		});
	</script>
</html>
